﻿using MediatR;
using S.Produce.Domains;
using S.Produce.Infrastructure;
using S.Produce.Read.Api.Application.Commands.BreedingCommands;

namespace S.Produce.Read.Api.Application.CommandHandlers.BreedingCommandHandlers
{
    public class HintBreedingCommandHandlers : IRequestHandler<HintBreedingCommands, List<Breeding>>
    {
        private readonly IRepository<Breeding> _repository; 

        public HintBreedingCommandHandlers(IRepository<Breeding> repository)
        {
            _repository = repository; 
        }

        public async Task<List<Breeding>> Handle(HintBreedingCommands request, CancellationToken cancellationToken)
        {
            return await _repository.GetAllAsync();
        }
    }
}
